#ifndef __MECH_H__
#define __MECH_H__

#include "cocos2d.h"
#include "SimpleAudioEngine.h"

USING_NS_CC;

class HelloWorld;

class Mech : public CCSprite
{
public:
	Mech();

    virtual bool initWithLayer(HelloWorld *layer,int kind,int hp);
	void moveToward(CCPoint targetPosition);

	bool moving;
	bool shooting;

	int hp;
	void updateMove(float dt);
	void update(float dt);
	void shootToward(CCPoint targetPosition);
	void shootNow();
	
	void destroyBullet(CCNode *node);
	virtual bool shouldShoot();
	void updateShoot(float dt);

protected:
	int _kind;
	HelloWorld *_layer;
	CCPoint _targetPosition;
	CCPoint _shootVector;
	double _timeSinceLastShot;
	CCSprite * _turret;
};

#endif